<?php 
header('content-type:text/html;charset=utf-8');

require_once '../include.php';

$username=$_POST['username'];
$username=addslashes($username);
$password=md5($_POST['password']);

$row=login($username, $password);

if($row){
	$_SESSION['adminName']=$row['username'];
	$_SESSION['adminId']=$row['id'];
	echo "登陆成功！<br/>3秒钟后跳转到首页<meta http-equiv='refresh' content='2;url=index.php'/>";
}else{
	alertMes("登陆失败，重新登陆","login.php");
}
